package com.aidong.myprofile.biz.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aidong.myprofile.biz.MySportLablesBiz;
import com.aidong.myprofile.dao.MySportLablesDao;

@Service("sportLablesBiz")
public class MySportLablesBizImpl implements MySportLablesBiz {
	
	private MySportLablesDao mySportLablesDao;

	@Autowired
	public void setMySportLablesDao(MySportLablesDao mySportLablesDao) {
		this.mySportLablesDao = mySportLablesDao;
	}

	/**
	 * 获得所有运动标签图标
	 * @return
	 */
	@Override
	public List<Map<String, Object>> getAllSportLables() {
		return mySportLablesDao.getAllSportLables();
	}

	/**
	 * 获得我的运动标签图标
	 * @return
	 */
	@Override
	public List<Map<String, Object>> getMySportLables(int idongId) {
		return mySportLablesDao.getMySportLables(idongId);
	}

	/**
	 * 添加我的运动标签
	 * 先删除  在添加
	 */
	@Override
	public void addMySportLables(List<Map<String, Object>> sportLablesMap) {
		mySportLablesDao.delMySportLables(Integer.parseInt(sportLablesMap.get(0).get("idongId").toString()));
		mySportLablesDao.addMySportLables(sportLablesMap);
	}

	@Override
	public void delMySportLables(int idongId) {
		mySportLablesDao.delMySportLables(idongId);
	}
}
